import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';

export const columns: BasicColumn[] = [
  {
    title: 'ID',
    dataIndex: 'id',
  },
  {
    title: '告警时间',
    dataIndex: 'time',
  },
  {
    title: '监控项',
    dataIndex: 'alarmType',
  },
  {
    title: '是否发送',
    dataIndex: 'send',
    slots: { customRender: 'sendCustom' },
  },
  {
    title: '告警内容',
    dataIndex: 'content',
    slots: { customRender: 'contentCustom' },
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'id',
    label: 'ID',
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    field: 'alarmType',
    label: '监控项',
    component: 'Select',
    colProps: { span: 6 },
    componentProps: {
      options: [
        { label: '主机CPU告警', value: 'CPU_LOAD_ALARM' },
        { label: '主机内存告警', value: 'MEMORY_LOAD_ALARM' },
        { label: '集群节点状态告警', value: 'CLUSTER_NODE' },
        { label: '规则引擎故障告警', value: 'RULE_ENGINE_ERROR' },
        { label: '非法连接告警', value: 'ILLEGAL_CONNECTION' },
        { label: '集群状态告警', value: 'CLUSTER_STATE_UPDATE' },
      ],
    },
  },
];
